Optimal. Leaf size=407 \[ \frac {b^2 e f-b (c d f+a e g+a d h)-2 a (c e f-c d g-a e h)-\left (2 c^2 d f+b (b d-a e) h-c (b e f+b d g-2 a e g+2 a d h)\right ) x}{\left (b^2-4 a c\right ) \left (c d^2-b d e+a e^2\right ) \left (a+b x+c x^2\right )}+\frac {\left (4 c^3 d^3 f+b e \left (4 a b d e h-2 a^2 e^2 h+b^2 \left (e^2 f-d e g-d^2 h\right )\right )-2 c^2 d \left (b d (3 e f+d g)-2 a \left (3 e^2 f-d e g+d^2 h\right )\right )+2 c e \left (2 b^2 d^2 g+2 a^2 e (e g-d h)-a b \left (3 e^2 f+d e g+d^2 h\right )\right )\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{\left (b^2-4 a c\right )^{3/2} \left (c d^2-b d e+a e^2\right )^2}+\frac {e \left (e^2 f-d e g+d^2 h\right ) \log (d+e x)}{\left (c d^2-b d e+a e^2\right )^2}-\frac {e \left (e^2 f-d e g+d^2 h\right ) \log \left (a+b x+c x^2\right )}{2 \left (c d^2-b d e+a e^2\right )^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.67, antiderivative size = 407, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {1660, 814, 648,
632, 212, 642} \begin {gather*} \frac {\tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right ) \left (2 c e \left (2 a^2 e (e g-d h)-a b \left (d^2 h+d e g+3 e^2 f\right )+2 b^2 d^2 g\right )+b e \left (-2 a^2 e^2 h+4 a b d e h+b^2 \left (d^2 (-h)-d e g+e^2 f\right )\right )-2 c^2 d \left (b d (d g+3 e f)-2 a \left (d^2 h-d e g+3 e^2 f\right )\right )+4 c^3 d^3 f\right )}{\left (b^2-4 a c\right )^{3/2} \left (a e^2-b d e+c d^2\right )^2}+\frac {-x \left (-c (2 a d h-2 a e g+b d g+b e f)+b h (b d-a e)+2 c^2 d f\right )-b (a d h+a e g+c d f)-2 a (-a e h-c d g+c e f)+b^2 e f}{\left (b^2-4 a c\right ) \left (a+b x+c x^2\right ) \left (a e^2-b d e+c d^2\right )}-\frac {e \log \left (a+b x+c x^2\right ) \left (d^2 h-d e g+e^2 f\right )}{2 \left (a e^2-b d e+c d^2\right )^2}+\frac {e \log (d+e x) \left (d^2 h-d e g+e^2 f\right )}{\left (a e^2-b d e+c d^2\right )^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 632
Rule 642
Rule 648
Rule 814
Rule 1660
Rubi steps
\begin {align*} \int \frac {f+g x+h x^2}{(d+e x) \left (a+b x+c x^2\right )^2} \, dx &=\frac {b^2 e f-b (c d f+a e g+a d h)-2 a (c e f-c d g-a e h)-\left (2 c^2 d f+b (b d-a e) h-c (b e f+b d g-2 a e g+2 a d h)\right ) x}{\left (b^2-4 a c\right ) \left (c d^2-b d e+a e^2\right ) \left (a+b x+c x^2\right )}+\frac {\int \frac {\frac {2 c^2 d^2 f-b c d (e f+d g)-b e (b e f-b d g+a d h)+2 a c \left (2 e^2 f-d e g+d^2 h\right )}{c d^2-b d e+a e^2}+\frac {e \left (2 c^2 d f+b (b d-a e) h-c (b e f+b d g-2 a e g+2 a d h)\right ) x}{c d^2-b d e+a e^2}}{(d+e x) \left (a+b x+c x^2\right )} \, dx}{-b^2+4 a c}\\ &=\frac {b^2 e f-b (c d f+a e g+a d h)-2 a (c e f-c d g-a e h)-\left (2 c^2 d f+b (b d-a e) h-c (b e f+b d g-2 a e g+2 a d h)\right ) x}{\left (b^2-4 a c\right ) \left (c d^2-b d e+a e^2\right ) \left (a+b x+c x^2\right )}+\frac {\int \left (-\frac {\left (b^2-4 a c\right ) e^2 \left (e^2 f-d e g+d^2 h\right )}{\left (c d^2-b d e+a e^2\right )^2 (d+e x)}+\frac {2 c^3 d^3 f+b e^2 \left (b^2 (e f-d g)+2 a b d h-a^2 e h\right )-c^2 d \left (b d (3 e f+d g)-2 a \left (3 e^2 f-d e g+d^2 h\right )\right )+c e \left (2 b^2 d^2 g+2 a^2 e (e g-d h)-a b \left (5 e^2 f-d e g+3 d^2 h\right )\right )+c \left (b^2-4 a c\right ) e \left (e^2 f-d e g+d^2 h\right ) x}{\left (c d^2-b d e+a e^2\right )^2 \left (a+b x+c x^2\right )}\right ) \, dx}{-b^2+4 a c}\\ &=\frac {b^2 e f-b (c d f+a e g+a d h)-2 a (c e f-c d g-a e h)-\left (2 c^2 d f+b (b d-a e) h-c (b e f+b d g-2 a e g+2 a d h)\right ) x}{\left (b^2-4 a c\right ) \left (c d^2-b d e+a e^2\right ) \left (a+b x+c x^2\right )}+\frac {e \left (e^2 f-d e g+d^2 h\right ) \log (d+e x)}{\left (c d^2-b d e+a e^2\right )^2}-\frac {\int \frac {2 c^3 d^3 f+b e^2 \left (b^2 (e f-d g)+2 a b d h-a^2 e h\right )-c^2 d \left (b d (3 e f+d g)-2 a \left (3 e^2 f-d e g+d^2 h\right )\right )+c e \left (2 b^2 d^2 g+2 a^2 e (e g-d h)-a b \left (5 e^2 f-d e g+3 d^2 h\right )\right )+c \left (b^2-4 a c\right ) e \left (e^2 f-d e g+d^2 h\right ) x}{a+b x+c x^2} \, dx}{\left (b^2-4 a c\right ) \left (c d^2-b d e+a e^2\right )^2}\\ &=\frac {b^2 e f-b (c d f+a e g+a d h)-2 a (c e f-c d g-a e h)-\left (2 c^2 d f+b (b d-a e) h-c (b e f+b d g-2 a e g+2 a d h)\right ) x}{\left (b^2-4 a c\right ) \left (c d^2-b d e+a e^2\right ) \left (a+b x+c x^2\right )}+\frac {e \left (e^2 f-d e g+d^2 h\right ) \log (d+e x)}{\left (c d^2-b d e+a e^2\right )^2}-\frac {\left (e \left (e^2 f-d e g+d^2 h\right )\right ) \int \frac {b+2 c x}{a+b x+c x^2} \, dx}{2 \left (c d^2-b d e+a e^2\right )^2}-\frac {\left (4 c^3 d^3 f+b e \left (4 a b d e h-2 a^2 e^2 h+b^2 \left (e^2 f-d e g-d^2 h\right )\right )-2 c^2 d \left (b d (3 e f+d g)-2 a \left (3 e^2 f-d e g+d^2 h\right )\right )+2 c e \left (2 b^2 d^2 g+2 a^2 e (e g-d h)-a b \left (3 e^2 f+d e g+d^2 h\right )\right )\right ) \int \frac {1}{a+b x+c x^2} \, dx}{2 \left (b^2-4 a c\right ) \left (c d^2-b d e+a e^2\right )^2}\\ &=\frac {b^2 e f-b (c d f+a e g+a d h)-2 a (c e f-c d g-a e h)-\left (2 c^2 d f+b (b d-a e) h-c (b e f+b d g-2 a e g+2 a d h)\right ) x}{\left (b^2-4 a c\right ) \left (c d^2-b d e+a e^2\right ) \left (a+b x+c x^2\right )}+\frac {e \left (e^2 f-d e g+d^2 h\right ) \log (d+e x)}{\left (c d^2-b d e+a e^2\right )^2}-\frac {e \left (e^2 f-d e g+d^2 h\right ) \log \left (a+b x+c x^2\right )}{2 \left (c d^2-b d e+a e^2\right )^2}+\frac {\left (4 c^3 d^3 f+b e \left (4 a b d e h-2 a^2 e^2 h+b^2 \left (e^2 f-d e g-d^2 h\right )\right )-2 c^2 d \left (b d (3 e f+d g)-2 a \left (3 e^2 f-d e g+d^2 h\right )\right )+2 c e \left (2 b^2 d^2 g+2 a^2 e (e g-d h)-a b \left (3 e^2 f+d e g+d^2 h\right )\right )\right ) \text {Subst}\left (\int \frac {1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{\left (b^2-4 a c\right ) \left (c d^2-b d e+a e^2\right )^2}\\ &=\frac {b^2 e f-b (c d f+a e g+a d h)-2 a (c e f-c d g-a e h)-\left (2 c^2 d f+b (b d-a e) h-c (b e f+b d g-2 a e g+2 a d h)\right ) x}{\left (b^2-4 a c\right ) \left (c d^2-b d e+a e^2\right ) \left (a+b x+c x^2\right )}+\frac {\left (4 c^3 d^3 f+b e \left (4 a b d e h-2 a^2 e^2 h+b^2 \left (e^2 f-d e g-d^2 h\right )\right )-2 c^2 d \left (b d (3 e f+d g)-2 a \left (3 e^2 f-d e g+d^2 h\right )\right )+2 c e \left (2 b^2 d^2 g+2 a^2 e (e g-d h)-a b \left (3 e^2 f+d e g+d^2 h\right )\right )\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{\left (b^2-4 a c\right )^{3/2} \left (c d^2-b d e+a e^2\right )^2}+\frac {e \left (e^2 f-d e g+d^2 h\right ) \log (d+e x)}{\left (c d^2-b d e+a e^2\right )^2}-\frac {e \left (e^2 f-d e g+d^2 h\right ) \log \left (a+b x+c x^2\right )}{2 \left (c d^2-b d e+a e^2\right )^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.55, size = 405, normalized size = 1.00 \begin {gather*} \frac {-2 a^2 e h+2 c^2 d f x+b^2 (-e f+d h x)+b c (-e f x+d (f-g x))+a b (d h+e (g-h x))+2 a c (e (f+g x)-d (g+h x))}{\left (b^2-4 a c\right ) \left (-c d^2+e (b d-a e)\right ) (a+x (b+c x))}-\frac {\left (-4 c^3 d^3 f+2 c^2 d \left (b d (3 e f+d g)-2 a \left (3 e^2 f-d e g+d^2 h\right )\right )+b e \left (-4 a b d e h+2 a^2 e^2 h+b^2 \left (-e^2 f+d e g+d^2 h\right )\right )+2 c e \left (-2 b^2 d^2 g+2 a^2 e (-e g+d h)+a b \left (3 e^2 f+d e g+d^2 h\right )\right )\right ) \tan ^{-1}\left (\frac {b+2 c x}{\sqrt {-b^2+4 a c}}\right )}{\left (-b^2+4 a c\right )^{3/2} \left (c d^2+e (-b d+a e)\right )^2}+\frac {e \left (e^2 f-d e g+d^2 h\right ) \log (d+e x)}{\left (c d^2+e (-b d+a e)\right )^2}-\frac {e \left (e^2 f-d e g+d^2 h\right ) \log (a+x (b+c x))}{2 \left (c d^2+e (-b d+a e)\right )^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(808\) vs.
\(2(401)=802\).
time = 0.19, size = 809, normalized size = 1.99
method | result | size |
default | \(\frac {e \left (d^{2} h -g d e +e^{2} f \right ) \ln \left (e x +d \right )}{\left (a \,e^{2}-d e b +c \,d^{2}\right )^{2}}-\frac {\frac {\frac {\left (a^{2} b \,e^{3} h +2 a^{2} c d \,e^{2} h -2 a^{2} c \,e^{3} g -2 a \,b^{2} d \,e^{2} h -a b c \,d^{2} e h +3 a b c d \,e^{2} g +a b c \,e^{3} f +2 a \,c^{2} d^{3} h -2 a \,c^{2} d^{2} e g -2 a \,c^{2} d \,e^{2} f +b^{3} d^{2} e h -b^{2} c \,d^{3} h -b^{2} c \,d^{2} e g -b^{2} c d \,e^{2} f +b \,c^{2} d^{3} g +3 b \,c^{2} d^{2} e f -2 c^{3} d^{3} f \right ) x}{4 a c -b^{2}}+\frac {2 a^{3} e^{3} h -3 a^{2} b d \,e^{2} h -a^{2} b \,e^{3} g +2 a^{2} c \,d^{2} e h +2 a^{2} c d \,e^{2} g -2 a^{2} c \,e^{3} f +a \,b^{2} d^{2} e h +a \,b^{2} d \,e^{2} g +a \,b^{2} e^{3} f -a b c \,d^{3} h -3 a b c \,d^{2} e g +a b c d \,e^{2} f +2 a \,c^{2} d^{3} g -2 a \,c^{2} d^{2} e f -b^{3} d \,e^{2} f +2 b^{2} c \,d^{2} e f -b \,c^{2} d^{3} f}{4 a c -b^{2}}}{c \,x^{2}+b x +a}+\frac {\frac {\left (4 a \,c^{2} d^{2} e h -4 a \,c^{2} d \,e^{2} g +4 a \,c^{2} e^{3} f -b^{2} c \,d^{2} e h +b^{2} c d \,e^{2} g -b^{2} c \,e^{3} f \right ) \ln \left (c \,x^{2}+b x +a \right )}{2 c}+\frac {2 \left (a^{2} b \,e^{3} h +2 a^{2} c d \,e^{2} h -2 a^{2} c \,e^{3} g -2 a \,b^{2} d \,e^{2} h +3 a b c \,d^{2} e h -a b c d \,e^{2} g +5 a b c \,e^{3} f -2 a \,c^{2} d^{3} h +2 a \,c^{2} d^{2} e g -6 a \,c^{2} d \,e^{2} f +b^{3} d \,e^{2} g -b^{3} e^{3} f -2 b^{2} c \,d^{2} e g +b \,c^{2} d^{3} g +3 b \,c^{2} d^{2} e f -2 c^{3} d^{3} f -\frac {\left (4 a \,c^{2} d^{2} e h -4 a \,c^{2} d \,e^{2} g +4 a \,c^{2} e^{3} f -b^{2} c \,d^{2} e h +b^{2} c d \,e^{2} g -b^{2} c \,e^{3} f \right ) b}{2 c}\right ) \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}}}{4 a c -b^{2}}}{\left (a \,e^{2}-d e b +c \,d^{2}\right )^{2}}\) | \(809\) |
risch | \(\text {Expression too large to display}\) | \(3801\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 860 vs.
\(2 (415) = 830\).
time = 4.01, size = 860, normalized size = 2.11 \begin {gather*} -\frac {{\left (d^{2} h e - d g e^{2} + f e^{3}\right )} \log \left (c x^{2} + b x + a\right )}{2 \, {\left (c^{2} d^{4} - 2 \, b c d^{3} e + b^{2} d^{2} e^{2} + 2 \, a c d^{2} e^{2} - 2 \, a b d e^{3} + a^{2} e^{4}\right )}} + \frac {{\left (d^{2} h e^{2} - d g e^{3} + f e^{4}\right )} \log \left ({\left | x e + d \right |}\right )}{c^{2} d^{4} e - 2 \, b c d^{3} e^{2} + b^{2} d^{2} e^{3} + 2 \, a c d^{2} e^{3} - 2 \, a b d e^{4} + a^{2} e^{5}} - \frac {{\left (4 \, c^{3} d^{3} f - 2 \, b c^{2} d^{3} g + 4 \, a c^{2} d^{3} h - 6 \, b c^{2} d^{2} f e + 4 \, b^{2} c d^{2} g e - 4 \, a c^{2} d^{2} g e - b^{3} d^{2} h e - 2 \, a b c d^{2} h e + 12 \, a c^{2} d f e^{2} - b^{3} d g e^{2} - 2 \, a b c d g e^{2} + 4 \, a b^{2} d h e^{2} - 4 \, a^{2} c d h e^{2} + b^{3} f e^{3} - 6 \, a b c f e^{3} + 4 \, a^{2} c g e^{3} - 2 \, a^{2} b h e^{3}\right )} \arctan \left (\frac {2 \, c x + b}{\sqrt {-b^{2} + 4 \, a c}}\right )}{{\left (b^{2} c^{2} d^{4} - 4 \, a c^{3} d^{4} - 2 \, b^{3} c d^{3} e + 8 \, a b c^{2} d^{3} e + b^{4} d^{2} e^{2} - 2 \, a b^{2} c d^{2} e^{2} - 8 \, a^{2} c^{2} d^{2} e^{2} - 2 \, a b^{3} d e^{3} + 8 \, a^{2} b c d e^{3} + a^{2} b^{2} e^{4} - 4 \, a^{3} c e^{4}\right )} \sqrt {-b^{2} + 4 \, a c}} - \frac {b c^{2} d^{3} f - 2 \, a c^{2} d^{3} g + a b c d^{3} h - 2 \, b^{2} c d^{2} f e + 2 \, a c^{2} d^{2} f e + 3 \, a b c d^{2} g e - a b^{2} d^{2} h e - 2 \, a^{2} c d^{2} h e + b^{3} d f e^{2} - a b c d f e^{2} - a b^{2} d g e^{2} - 2 \, a^{2} c d g e^{2} + 3 \, a^{2} b d h e^{2} - a b^{2} f e^{3} + 2 \, a^{2} c f e^{3} + a^{2} b g e^{3} - 2 \, a^{3} h e^{3} + {\left (2 \, c^{3} d^{3} f - b c^{2} d^{3} g + b^{2} c d^{3} h - 2 \, a c^{2} d^{3} h - 3 \, b c^{2} d^{2} f e + b^{2} c d^{2} g e + 2 \, a c^{2} d^{2} g e - b^{3} d^{2} h e + a b c d^{2} h e + b^{2} c d f e^{2} + 2 \, a c^{2} d f e^{2} - 3 \, a b c d g e^{2} + 2 \, a b^{2} d h e^{2} - 2 \, a^{2} c d h e^{2} - a b c f e^{3} + 2 \, a^{2} c g e^{3} - a^{2} b h e^{3}\right )} x}{{\left (c d^{2} - b d e + a e^{2}\right )}^{2} {\left (c x^{2} + b x + a\right )} {\left (b^{2} - 4 \, a c\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 6.70, size = 2500, normalized size = 6.14 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________